<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>修改密码</title>
	<script src="__INDEX__/js/mui.min.js"></script>
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/css/style.css" />
		<link rel="stylesheet" href="__INDEX__/css/mall.css" />
		
	</head>

	<body >
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
			<h1 class="mui-title">修改密码</h1>
		</header>
		<div class="mui-content ">
				<div class="mui-content" style="height: 100%;">
			<form id='my_form' class="mui-input-group gerenzl_group layui-form update_form" style="height: 100%;">
				<ul class="fjysq_slis">
					<li class="clearfix">
						<div class="left">旧密码</div>
						<div class="right clearfix"><input type="password" id="pwd" value="" name="name" placeholder="请填写旧密码"></div>
					</li>
					<li class="clearfix">
						<div class="left">新密码</div>
						<div class="right clearfix"><input type="password" id="pwd1" value="" name="name" placeholder="请填写新密码"></div>
					</li>
					<li class="clearfix">
						<div class="left">再次填写新密码</div>
						<div class="right clearfix"><input type="password" id="pwd2" value="" name="name" placeholder="请再次填写新密码"></div>
					</li>
				</ul>
				<button type="button" onclick="set_content()" class="fjysq_sbtn" style="display: block;">保存</button> 
		</div>
		</form>
		</div>
	</body>

</html>

{include file="public/footer" /}
<script type="text/javascript">
		function set_content(){
			var pwd=$("#pwd").val();
			var pwd1=$("#pwd1").val();
			var pwd2=$("#pwd2").val();
			if(pwd==''||pwd1==''||pwd2==''){
				layer.msg("请输入正确的密码");
				return;
			}
			if(pwd1!=pwd2){
				layer.msg("两次密码输入不一致");
				return;
			}
			$.ajax({
				type:"POST",
				url: "{:url('admin/update_pwd')}",
				data: {pwd:pwd,pwd1:pwd1},
				success: function(data) {
					if(data.code == 200){
						layer.msg('修改成功',function(){
							location.href = 'index.html';
						});
					}else{
						layer.msg('修改失败');
					}
				}
			})
		}
</script>
